<form id="shopcategory" name="shopcategory" method="post" action="shopcategory.manage.php">
<input type="hidden" name="action" value="save" />
<table class="from_table">
  <tr>
    <th class="th1"><tpl> $langShopClassName </tpl>：</td>
    <td width="530" class="td1"><input name="txtClassName" class="txtinput" type="text" id="txtClassName" value="<tpl> $category_array.class_name </tpl>" maxlength="30" /></td>
		</tr>
		<tr>
		  <th class="th1"><tpl> $langShopClassParent </tpl>：</td>
		  <td width="530" class="td1"><tpl> $select_parent_category </tpl></td>
		</tr>
		<tr>
		  <th class="th1"><tpl> $langShopClassProperty </tpl>：</td>
		 <td width="530" class="td1"><tpl> $radio_category_property </tpl></td>
		</tr>
		<tr>
		  <th class="th1"><tpl> $langCSort </tpl>：</td>
		  <td width="530" class="td1"><input name="txtClassSort" class="txtinput" type="text" id="txtClassSort" value="<tpl> $category_array.class_sort|default:'0' </tpl>" size="5" maxlength="5" /></td>
		</tr>
		<tr>
		  <th class="th1"><tpl> $langShopClassState </tpl>：</td>
		  <td width="530" class="td1"><tpl> $radio_category_state </tpl></td>
		</tr>
		<tr>

		</tr><input name="hideClassId" type="hidden" id="hideClassId" value="<tpl> $category_array.class_id </tpl>" /><input name="hideOperate" type="hidden" id="hideOperate" value="<tpl> $category_operate </tpl>" />
	  </table>
	  <div class="table-5-bottom"><div class="p-left-2"><span class="btn_left">
	      <input type="submit" class="btn_submit" name="Submit" value="<tpl> $langCsave </tpl>" /></span><span class="btn_left"><input type="button" class="btn_submit" name="butt_list" id="butt_list" value="<tpl> $langSysShopReturnList </tpl>" /></span></div></div>
	</form>
<script>
$(document).ready(function() {
	//返回列表
	$('#butt_list').click(function(){
		ST(0,0);
		ShowDiv = "result_content";
		getPageContent("shopcategory.manage.php?action=ajax_list");
	})

	hideMessage();		
//编辑
	var options = {
		beforeSubmit:  function(){showLoading(showSaveText);},
		success:       function(msg){
							hideLoading();
							showMessage(msg.message,msg.type);
							if(msg.type == '1'){
								ST(0,0);
								ShowDiv	= 'result_content';
								getPageContent("shopcategory.manage.php?action=ajax_list");
							}
						},
		type:      'post',
		dataType:  'json'
	};
	
	//对添加表单做的验证定义
	$("#shopcategory").validate({
		errorClass: "wrong",
		rules: {
			txtClassName: {required:true}
		},
		messages: {
			txtClassName: {required: "<tpl> $langSysShopPleaseFillInClass </tpl>"}
		},
		submitHandler: function() {
			$('#shopcategory').ajaxSubmit(options);
		}
	});
});
</script>